package com.jy.rhin.infra.repo.node;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jy.common.UIDWorker;
import com.jy.rhin.domain.document.node.NodeAuthenticationPermissionDao;
import com.jy.rhin.infra.repo.node.mapper.NodeAuthenticationPermissionMapper;
import com.jy.rhin.infra.repo.node.po.NodeAuthenticationPermissionPo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 *
 */
@Service
public class NodeAuthenticationPermissionDaoImpl implements NodeAuthenticationPermissionDao {

    @Resource
    UIDWorker uidWorker;
    @Resource
    private NodeAuthenticationPermissionMapper nodeAuthenticationPermissionMapper;


//    @Override
//    public Long save(NodeAuthenticationPo nodeAuthenticationPo) {
//        long id = uidWorker.nextId();
//        nodeAuthenticationMapper.insert(nodeAuthenticationPo);
//        return id;
//    }
//
//    @Override
//    public Integer update(NodeAuthenticationPo nodeAuthenticationPo) {
//        return  nodeAuthenticationMapper.updateById(nodeAuthenticationPo);
//    }

    @Override
    public List<NodeAuthenticationPermissionPo> getAllPermission() {
        QueryWrapper<NodeAuthenticationPermissionPo> wrapper = new QueryWrapper<>();
        return nodeAuthenticationPermissionMapper.selectList(wrapper);
    }
}
